-module(test_jiujiu).
-compile(export_all). 

foo() -> foo(1,1).	 
foo(9,9) -> io:format("~p*~p=~p \n", [9,9,9*9]);
foo(9,Y) -> io:format("~p*~p=~p \n", [9,Y,9*Y]), foo(1,Y+1);
foo(X,X) -> io:format("~p*~p=~p   ", [X,X,X*X]), foo(X+1,X);
foo(X,Y) -> io:format("~p*~p=~p   ", [X,Y,X*Y]), foo(X+1,Y).


bsort([]) -> [];
bsort(List) -> bsort(List, [], [], length(List) - -1, 0).

bsort(List, Temp, Final, Count, Swapped) when Swapped =:= Count ->
	lists:append(lists:reverse(Final), [X|Temp]);

bsort([X], Temp, Final, Count, _Swapped)->
	bsort(Temp, [], [X|Final], Count - 1, 0);


